<?php /* Smarty version Smarty-3.0.7, created on 2014-09-11 06:45:59
         compiled from "./templates\admin/homeworkList.html" */ ?>
<?php /*%%SmartyHeaderCode:720354114527c49c00-13876993%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'd7f4c18115196663ee046e826365383ca2416236' => 
    array (
      0 => './templates\\admin/homeworkList.html',
      1 => 1410414664,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '720354114527c49c00-13876993',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<?php if (!is_callable('smarty_modifier_truncate')) include 'C:\wamp\www\E_T_System\admin_core\smarty\plugins\modifier.truncate.php';
if (!is_callable('smarty_modifier_date_format')) include 'C:\wamp\www\E_T_System\admin_core\smarty\plugins\modifier.date_format.php';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
*{font-family:Tahoma, Arial, Helvetica, Sans-serif,"宋体";}
table{
	width:85%;
	margin:0px auto;
	font:Georgia 11px;
	font-size:12px;
	color:#333333;
	text-align:center;
	border-collapse:collapse;/*细线表格代码*/
}
table td{
	border:1px solid #999;/*细线表格线条颜色*/
	height:22px;
}
caption{text-align:center;font-size:12px;font-weight:bold;margin:0 auto;}
tr.t1 td {background-color:#fff;}
tr.t2 td {background-color:#eee;}
tr.t3 td {background-color:#ccc;}
th,tfoot tr td{font-weight:bold;text-align:center;background:#c5c5c5;}
th{line-height:30px;height:30px;}
tfoot tr td{background:#fff;line-height:26px;height:26px;}
thead{border:1px solid #999;}
thead tr td{text-align:center;}
#page{text-align:center;float:right;}
#page a,#page a:visited{width:60px;height:22px;line-height:22px;border:1px black solid;display:block;float:left;margin:0 3px;background:#c9c9c9;
text-decoration:none;}
#page a:hover{background:#c1c1c1;text-decoration:none;}
.grayr {padding:2px;font-size:11px;background:#fff;float:right;}
.grayr a {padding:2px 5px;margin:2px;color:#000;text-decoration:none;;border:1px #c0c0c0 solid;}
.grayr a:hover {color:#000;border:1px orange solid;}
.grayr a:active {color:#000;background: #99ffff}
.grayr span.current {padding:2px 5px;font-weight:bold; margin:2px; color: #303030;background:#fff;border:1px orange solid;}
.grayr span.disabled {padding:2px 5px;margin:2px;color:#797979;background: #c1c1c1;border:1px #c1c1c1 solid;}
a{
	text-decoration:none;
	}
	img{
		border:0px;}
-->
</style>
<script src="../admin_core/js/list.js"></script>
<script type="text/javascript"><!--
function selectPage(obj)
{

	var value = obj.value;
	document.location.href="control.php?action=getHomeworkList&page="+value+"&countPage=<?php echo $_smarty_tpl->getVariable('countPage')->value;?>
&count=<?php echo $_smarty_tpl->getVariable('count')->value;?>
&keyword=<?php echo $_smarty_tpl->getVariable('keyword')->value;?>
&before=<?php echo $_smarty_tpl->getVariable('before')->value;?>
&after=<?php echo $_smarty_tpl->getVariable('after')->value;?>
&type=<?php echo $_smarty_tpl->getVariable('type')->value;?>
&hwType=<?php echo $_smarty_tpl->getVariable('hwType')->value;?>
&xyId=<?php echo $_smarty_tpl->getVariable('xyId')->value;?>
&lsId=<?php echo $_smarty_tpl->getVariable('lsId')->value;?>
";
	}
	function readHWDetails(hwId)
		{
			window.open('../readHW.php?hwId='+hwId,'作业信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			}
	function select()
	{
		var logList =  document.getElementsByName("hwId[]");
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			obj.checked =!obj.checked;
			}
		
	}

function search()
{
	var keyWord = document.getElementById('keword').value;
	var type = document.getElementById('searchtype').value;
	var before=document.getElementById('before').value;
	var after=document.getElementById('after').value;
	var hwType = document.getElementById('hwType').value;
	var xyId = document.getElementById('xyId').value;
    var lsId = document.getElementById('lsId').value;
		if(before=="")
		{
			before=0;
			}
			if(after=="")
			{
				after=0;
				}
				if(xyId=='none')
				{
					xyId=0;
					}
					if(lsId=='none')
					{
						lsId=0;
						}
						if(type!=3)
						{
							if(before=="")
							{
							alert("请选择一个开始时间！");
							document.getElementById('before').focus();
							return ;
							}
							else if(after=="")
							{
								
								alert("请选择一个结束时间！");
								document.getElementById('after').focus();
								return ;
								}
						}
	document.location.href="control.php?action=getHomeworkList&keyword="+keyWord+"&type="+type+"&before="+before+"&after="+after+"&hwType="+hwType+"&xyId="+xyId+"&lsId="+lsId;
	}

	
			var xmlHttp;
	function setXmlHttpRequest()
{
	if(window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
		else if(window.XMLHttpRequest)
		{
			xmlHttp = new XMLHttpRequest();
			}
	}
	
	function ajaxFun(url,funName)
	{
		setXmlHttpRequest();
		url = encodeURI(url);
		xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange = funName;
		xmlHttp.send(null);
		}
			function getLs()
			{
				var xyId = document.getElementById('xyId').value;
				if(xyId!="none")
					{
				var url = "controlXs.php?action=getLs&xyId="+xyId;
				ajaxFun(url,setLs);
			}
			else
			{
				document.getElementById('lsSelect').innerHTML = "<select name='lsId' id='lsId' style='width:140px; height:20px; color:#09C; border:#999 1px solid;'><option value='none'>设定搜索的老师</option></select>";
				}
			}
				function setLs()
				{
				if(xmlHttp.readyState == 4)
				{
					if(xmlHttp.status == 200)
					{
						document.getElementById('lsSelect').innerHTML=xmlHttp.responseText;;
						
						}
					}		
					}
					function checkTeacherDetail(lsId)
	{
		window.open('../readTeacherDetail.php?lsId='+lsId,'老师信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
		}
			function checkChecked()
	{
		var logList =  document.getElementsByName("hwId[]");
		var checkState = false;
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			if(obj.checked)
				{
				checkState = true;
				}
			
			}
		if(!checkState)
			{
			alert("至少选中一个！");
			}
		else
			{
			if(confirm("确认删除吗？"))
			document.getElementById('selectForm').submit();
			
			}
	}
			function checkSubmitDetail(hwId)
	{
		window.open('../submitHW.php?hwId='+hwId,'提交信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
		}
--></script>
<script type="text/javascript" src="date/WdatePicker.js"></script>
</head>

<body style="text-align:center;" >
<center>
<br />
<fieldset style="width:1110px;">
<legend><span style="color:#000; font-size:14px; font-weight:bold;"><img src="images/search_16x16.gif" width="16" height="16" />&nbsp;搜索作业
</span></legend>
<span style="font-size:12px; font-weight:bold;">

<span style="float:left; margin-left:50px;">
搜索条件：
  <select name="xyId" id="xyId" style="width:150px; height:20px; color:#09C; border:#999 1px solid;" onchange="getLs()">
    <option value="none">设定搜索的学院/部门</option>
<?php  $_smarty_tpl->tpl_vars['xy'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('xyList')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['xy']->key => $_smarty_tpl->tpl_vars['xy']->value){
?>
    <option value="<?php echo $_smarty_tpl->getVariable('xy')->value->getXy_id();?>
"><?php echo $_smarty_tpl->getVariable('xy')->value->getXy_name();?>
</option>
<?php }} ?>
  </select>
<font color="#000000" style="font-weight:bolder">--></font>
<span id="lsSelect">
<select name="lsId" id="lsId" style="width:140px; height:20px; color:#09C; border:#999 1px solid;">
  <option value="none">设定搜索的老师</option>
</select>
</span>
</span>
<div style="clear:both; height:10px;">
</div>
<span style="float:left; margin-left:50px; ">
设定提交时间搜索：
<select name="searchtype" id="searchtype" style="width:140px; height:20px; color:#09C; border:#999 1px solid;"  onchange="if(this.value!=3){document.getElementById('before').focus();}
">
  <option value="3" > 常规搜索 </option>
  <option value="1"> 设定开始提交时间 </option>
  <option value="2"> 设定截至提交时间 </option>
</select>
时间上限：
<input  type="text" name="before" id="before" readonly="readonly"  class="Wdate"onfocus="var after=$dp.$('after');WdatePicker({onpicked:function(){after.focus();},maxDate:'#F{$dp.$D(\'after\')}'})"
 style="width:150px; height:20px; color:#09C;" />
 时间下限：
 <input  type="text" name="after" id="after" readonly="readonly"  class="Wdate" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'before\')}'})" style="width:150px; height:20px; color:#09C;" >
</span>
 <div style="clear:both; height:10px;">
 </div>
 <span style="float:left; margin-left:50px;">
作业类型：
<select name="hwType" id="hwType" style=" height:20px; color:#09C; border:#999 1px solid;">
<option value="3" 
<?php if ($_smarty_tpl->getVariable('hwType')->value==3){?>
selected="selected"
<?php }?>
>任意</option>
<option value="1"
<?php if ($_smarty_tpl->getVariable('hwType')->value==1){?>
selected="selected"
<?php }?>
>选做</option>
<option value="2"
<?php if ($_smarty_tpl->getVariable('hwType')->value==2){?>
selected="selected"
<?php }?>
>必做</option>
</select>
</span>
<div style="clear:both; height:10px;">
</div>
<span style="float:left; margin-left:50px;">
请输入作业名或者作业名包含的关键词：
<input  type="text" name="keword" id="keword" 
 style="width:180px; height:20px; color:#09C; border:#999 1px solid;" />&nbsp;&nbsp;
 <input type="button" value=" 搜 索 " onclick="search()" style="width:80px; height:25px;" />
</span>
</span>
</fieldset>
<br />
<fieldset style="width:1110px;">
<legend><img src="images/311.gif"/>&nbsp;<span style="color:#333; font-size:15px; font-weight:bold;">作业列表</span></legend>
<form id="selectForm" action="control.php?action=deleteHW" method="post">
  <table width="100%" style="border:1px #333 solid; border-collapse:collapse;">
    <thead>
      <tr>
       <th width="7%" onclick="select()" style="cursor: pointer;" title="全选/反选">全选/反选</th>
        <th style=" border:1px #333 solid;">作业标题</th>
        <th width="10%" style=" border:1px #333 solid;">老师姓名</th>
        <th width="13%" style=" border:1px #333 solid;">开始提交时间</th>
        <th width="13%" style=" border:1px #333 solid;">截至提交时间</th>
        <th width="10%" style=" border:1px #333 solid;">作业类型</th>
        <th width="25%" style=" border:1px #333 solid;">操作</th>
      </tr>
    </thead>
<?php if ($_smarty_tpl->getVariable('count')->value==0){?>
<tr>
<td colspan="7" align="center" style="text-align:center; border:1px #333 solid;">暂无数据！</td>
</tr>
<?php }else{ ?>
    <?php  $_smarty_tpl->tpl_vars['hw'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('list')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['hw']->key => $_smarty_tpl->tpl_vars['hw']->value){
?>
    
  <tr onmousemove="changeBackColor(this)" onmouseout="removeBackColor(this)">
     <td width="7%" align="center">
      <input name="hwId[]" type="checkbox" value="<?php echo $_smarty_tpl->getVariable('hw')->value->getWt_id();?>
" />
      </td>
    <td  align="left" onclick="readHWDetails(<?php echo $_smarty_tpl->getVariable('hw')->value->getWt_id();?>
)" style="cursor:pointer; padding-left:5px; border:1px #333 solid;" title="点击查看详细信息" ><?php echo smarty_modifier_truncate($_smarty_tpl->getVariable('hw')->value->getWt_name(),30,"....");?>
 </td>
    <td width="10%" align="left" onclick="checkTeacherDetail(<?php echo $_smarty_tpl->getVariable('hw')->value->getLs()->getLs_id();?>
)" title="点击查看详细信息" style="cursor:pointer; border:1px #333 solid;padding-left:5px;"><?php echo $_smarty_tpl->getVariable('hw')->value->getLs()->getLs_name();?>
</td>
    <td width="13%" align="center"  style=" border:1px #333 solid;"><?php echo smarty_modifier_date_format($_smarty_tpl->getVariable('hw')->value->getStart_time(),'%Y-%m-%d');?>
</td>
    <td width="13%" align="center "  style=" border:1px #333 solid;"><?php echo smarty_modifier_date_format($_smarty_tpl->getVariable('hw')->value->getEnd_time(),'%Y-%m-%d');?>
</td>
    <td width="10%" align="center"  style=" border:1px #333 solid;"> <?php if ($_smarty_tpl->getVariable('hw')->value->getWt_type()==1){?>
      必做
      <?php }else{ ?>
      选做
      <?php }?> </td>
    <td width="25%"  style=" border:1px #333 solid;">
         <a href="#" onclick="readHWDetails(<?php echo $_smarty_tpl->getVariable('hw')->value->getWt_id();?>
)" title="查看该作业详细信息">  <img src="images/view_16x16.gif" title="获取详细信息" width="14" height="14"/>查看详细信息</a>&nbsp;<a href="#" onclick="checkSubmitDetail(<?php echo $_smarty_tpl->getVariable('hw')->value->getWt_id();?>
)" title="获取详细信息" ><img src="images/view_16x16.gif" title="获取详细信息"  width="14" height="14"/>查看作业提交情况</a>
    </td>
  </tr>
    <?php }} ?>
     <tr>
 <td align="center" style="border-right:0px; cursor: pointer;  border-right:#999 1px solid;"  onclick="select()" title="全选/反选">
 全选/反选
 </td>
 <td colspan="6" align="left" style="text-align:left; border-left:0px;">
 <input type="button" value=" 删除选中记录 "   style="font-size:13px; width:100px; height:25px;" onclick="checkChecked()"/> 
 </td>
 </tr>
 <?php }?>
  <tfoot>
    <tr>
      <td colspan="7" align="right" style="text-align:right; border:1px #333 solid;"> 共有<?php echo $_smarty_tpl->getVariable('count')->value;?>
条记录 总共有<?php echo $_smarty_tpl->getVariable('countPage')->value;?>
页 当前为<?php echo $_smarty_tpl->getVariable('start')->value;?>
-<?php echo $_smarty_tpl->getVariable('end')->value;?>
条 在第<?php echo $_smarty_tpl->getVariable('nowPage')->value;?>
页
        <?php if ($_smarty_tpl->getVariable('nowPage')->value==1){?>
        上一页
        <?php }else{ ?> <a href="control.php?action=getHomeworkList&page=<?php echo $_smarty_tpl->getVariable('nowPage')->value-1;?>
&countPage=<?php echo $_smarty_tpl->getVariable('countPage')->value;?>
&count=<?php echo $_smarty_tpl->getVariable('count')->value;?>
&keyword=<?php echo $_smarty_tpl->getVariable('keyword')->value;?>
&before=<?php echo $_smarty_tpl->getVariable('before')->value;?>
&after=<?php echo $_smarty_tpl->getVariable('after')->value;?>
&type=<?php echo $_smarty_tpl->getVariable('type')->value;?>
&hwType=<?php echo $_smarty_tpl->getVariable('hwType')->value;?>
&xyId=<?php echo $_smarty_tpl->getVariable('xyId')->value;?>
&lsId=<?php echo $_smarty_tpl->getVariable('lsId')->value;?>
">上一页</a> <?php }?>
        
        <?php if ($_smarty_tpl->getVariable('countPage')->value>$_smarty_tpl->getVariable('nowPage')->value){?> <a href="control.php?action=getHomeworkList&page=<?php echo $_smarty_tpl->getVariable('nowPage')->value+1;?>
&countPage=<?php echo $_smarty_tpl->getVariable('countPage')->value;?>
&count=<?php echo $_smarty_tpl->getVariable('count')->value;?>
&keyword=<?php echo $_smarty_tpl->getVariable('keyword')->value;?>
&before=<?php echo $_smarty_tpl->getVariable('before')->value;?>
&after=<?php echo $_smarty_tpl->getVariable('after')->value;?>
&type=<?php echo $_smarty_tpl->getVariable('type')->value;?>
&hwType=<?php echo $_smarty_tpl->getVariable('hwType')->value;?>
&xyId=<?php echo $_smarty_tpl->getVariable('xyId')->value;?>
&lsId=<?php echo $_smarty_tpl->getVariable('lsId')->value;?>
"> 下一页</a> <?php }else{ ?>
        下一页
        <?php }?>
        跳至
        <select name="select" onchange="selectPage(this)">
          
  <?php unset($_smarty_tpl->tpl_vars['smarty']->value['section']['a']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['loop'] = is_array($_loop=$_smarty_tpl->getVariable('countPage')->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['name'] = 'a';
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['a']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['a']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['a']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['a']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['a']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['a']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['a']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['a']['total']);
?>

          <option value="<?php echo $_smarty_tpl->getVariable('smarty')->value['section']['a']['iteration'];?>
" <?php if ($_smarty_tpl->getVariable('smarty')->value['section']['a']['iteration']==$_smarty_tpl->getVariable('nowPage')->value){?> selected="selected"<?php }?>><?php echo $_smarty_tpl->getVariable('smarty')->value['section']['a']['iteration'];?>
页</option>
          
<?php endfor; endif; ?>

        </select>
        &nbsp;&nbsp; </td>
    </tr>
  </tfoot>
  </table>
</form>
</fieldset>
</center>
</body>
</html>
